﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace ComicReader.Helpers
{
    public class GetFileInformationIconConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((value is FileInfo))
            {

                var extension = Path.GetExtension((value as FileInfo).Name);
                switch (extension)
                {
                    case ".cbr":
                        return "/Content/Images/cbr.png";
                    case ".cbz":
                        return "/Content/Images/cbz.png";
                }
            }
            return "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
